<?php

/**
 * SessionCaisseReglement form base class.
 *
 * @method SessionCaisseReglement getObject() Returns the current form's model object
 *
 * @package    SdCommerce
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseSessionCaisseReglementForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'                  => new sfWidgetFormInputHidden(),
      'id_user'             => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('sfGuardUser'), 'add_empty' => true)),
      'id_caisse_reglement' => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('CaisseReglement'), 'add_empty' => true)),
      'fond'                => new sfWidgetFormInputText(),
      'total_recette'       => new sfWidgetFormInputText(),
      'date_ouverture'      => new sfWidgetFormInputText(),
      'date_cloture'        => new sfWidgetFormInputText(),
      'total_benefice'      => new sfWidgetFormInputText(),
      'total_depence'       => new sfWidgetFormInputText(),
      'total_remise'        => new sfWidgetFormInputText(),
      'total_tva'           => new sfWidgetFormInputText(),
      'total_caisse'        => new sfWidgetFormInputText(),
      'created_at'          => new sfWidgetFormDateTime(),
      'updated_at'          => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'                  => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id')), 'empty_value' => $this->getObject()->get('id'), 'required' => false)),
      'id_user'             => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('sfGuardUser'), 'required' => false)),
      'id_caisse_reglement' => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('CaisseReglement'), 'required' => false)),
      'fond'                => new sfValidatorNumber(array('required' => false)),
      'total_recette'       => new sfValidatorNumber(array('required' => false)),
      'date_ouverture'      => new sfValidatorPass(array('required' => false)),
      'date_cloture'        => new sfValidatorPass(array('required' => false)),
      'total_benefice'      => new sfValidatorNumber(array('required' => false)),
      'total_depence'       => new sfValidatorNumber(array('required' => false)),
      'total_remise'        => new sfValidatorNumber(array('required' => false)),
      'total_tva'           => new sfValidatorNumber(array('required' => false)),
      'total_caisse'        => new sfValidatorNumber(array('required' => false)),
      'created_at'          => new sfValidatorDateTime(),
      'updated_at'          => new sfValidatorDateTime(),
    ));

    $this->widgetSchema->setNameFormat('session_caisse_reglement[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'SessionCaisseReglement';
  }

}
